<h1>Narudžbine</h1>
<div class="elementFilter">
    <form action="<?php echo url_for('narudzbina/index') ?>" method="post">
     <table ><tr>
    <?php echo $filter ?>

    <td ></td><td colspan="2" align="center">    <input type="submit" value="Pošalji"> </td></tr>
       </table>
        </form>

</div>
<?php if ($narudzbina_list): ?>

        
           

         
        <table id="rounded-corner" >
            <thead>
                <tr>

                    <th class="rounded-company">Datum narudzbine</th>
                    <th>Status</th>

                    <th>Nacin placanja</th>
                    <th>Nacin isporuke</th>
                    <th>Proizvodi</th>
                    <th class="rounded-qend">Kolicina</th>
                </tr>
            </thead>
            <tfoot>
    	<tr>
        	<td colspan="" class="rounded-foot-left">&nbsp;</td>
                <td colspan="4" ><em><?php if ($pager->haveToPaginate()): ?>
  <?php echo link_to('&laquo;', 'narudzbina/index?page='.$pager->getFirstPage()) ?>
  <?php echo link_to('&lt;', 'narudzbina/index?page='.$pager->getPreviousPage()) ?>
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <?php echo ($page == $pager->getPage()) ? $page : link_to($page, 'narudzbina/index?page='.$page) ?>
    <?php if ($page != $pager->getCurrentMaxLink()): ?> - <?php endif ?>
  <?php endforeach ?>
  <?php echo link_to('&gt;', 'narudzbina/index?page='.$pager->getNextPage()) ?>
  <?php echo link_to('&raquo;', 'narudzbina/index?page='.$pager->getLastPage()) ?>
<?php endif ?>

               
</em></td>
                    
        	<td class="rounded-foot-right"> &nbsp</td>
        </tr>
    </tfoot>
            <tbody>
        <?php foreach ($narudzbina_list as $narudzbina): ?>
            <tr>
                <td><?php echo $narudzbina->getDatumNarudzbine() ?></td>
                <td><?php echo $narudzbina->getStatus()->getNaziv() ?></td>

                <td><?php echo $narudzbina->getNacinPlacanja()->getNaziv() ?></td>
                <td><?php echo $narudzbina->getNacinIsporuke()->getNaziv() ?></td>
                <td><?php
            foreach ($list[$narudzbina->getId()] as $entry) {
                echo $entry['naziv'] . "<br/>";
            }
        ?></td>
            <td><?php
                foreach ($list[$narudzbina->getId()] as $entry) {
                    echo $entry['kolicina'] . "<br/>";
                }
        ?></td>
        </tr>
                <?php endforeach; ?>
    </tbody>
</table>
 <?php else: ?> <h4>Nema narudzbina</h4>
<?php endif; ?>